﻿//@author generated
#pragma once
#pragma comment( lib, "Winmm.lib" )
#include "UserCommand.h" 
#include "Stdtosys.h"
#include <msclr\marshal_cppstd.h>
#include "InternalCommand.h"
#include <playsoundapi.h>

namespace TaskExemplarGUI {
	using TimeManipulator::getRandomNumber;
	using namespace System;
	using namespace System::ComponentModel;
	using namespace System::Collections;
	using namespace System::Windows::Forms;
	using namespace System::Data;
	using namespace System::Drawing;
	using namespace System::IO;
	using namespace msclr::interop;

	static const int MINIMUM_HEIGHT = 600;
	static const int MINIMUM_WIDTH = 800;
	static const double LEFT_PORTION = 0.70;
	static const double UPPER_PORTION = 0.8;
	static const int MARGIN = 5;
	/// <summary>
	/// Summary for TaskExemplarGUI
	/// </summary>

	//@author A0087294R
	public ref class TaskExemplarGUI : public System::Windows::Forms::Form
	{
	private:
		UserCommand* userCommand;
		OutputDisplay* outputDisplay;
		Hinter* hinter;
		static System::Windows::Forms::Timer^ myTimer = gcnew System::Windows::Forms::Timer;
		static int alarmCounter;

	public:
		TaskExemplarGUI(void) {
			
			InitializeComponent();
			outputDisplay = &OutputDisplay::get();
			static UserCommand newCommand;
			userCommand = &newCommand;
			hinter = &Hinter::get();
			alarmCounter = 0;
		}
		/// <summary>
		/// Clean up any resources being used.
		/// </summary>
		//@author A0087294R
		~TaskExemplarGUI()
		{
			if (components)
			{
				delete components;
				//delete outputDisplay;
				//delete userCommand;
				//delete hinter;
			}
		}

//@author generated
	protected: 

	private: System::Windows::Forms::TextBox^  InputTextBox;

	private: System::Windows::Forms::TabControl^  TabDisplay;
	private: System::Windows::Forms::TabPage^  UpcomingTab;
	private: System::Windows::Forms::TextBox^  UpcomingTextBox;

	private: System::Windows::Forms::TabPage^  TodayTab;
	private: System::Windows::Forms::TextBox^  TodayTextBox;
	private: System::Windows::Forms::TabPage^  MissedTab;
	private: System::Windows::Forms::TextBox^  MissedTextBox;

	private: System::Windows::Forms::TextBox^  PastOperations;

	private: System::Windows::Forms::Label^  HelpPrompt;

	private: System::Windows::Forms::Label^  FloatingTasksLabel;
	private: System::Windows::Forms::Label^  PastActionLabel;
	private: System::ComponentModel::IContainer^  components;

	private: System::Windows::Forms::TabPage^  FavouriteTab;
	private: System::Windows::Forms::TextBox^  FavouriteTextBox;
	private: System::Windows::Forms::TabPage^  FloatingTab;
	private: System::Windows::Forms::TextBox^  FloatTextBox;
	private: System::Windows::Forms::Timer^  tmrClock;
	private: System::Windows::Forms::TextBox^  FunnyTxtBox;
	
	protected: 

	private:
		/// <summary>
		/// Required designer variable.
		/// </summary>


#pragma region Windows Form Designer generated code
		/// <summary>
		/// Required method for Designer support - do not modify
		/// the contents of this method with the code editor.
		/// </summary>
		void InitializeComponent(void)
		{
			this->components = (gcnew System::ComponentModel::Container());
			this->InputTextBox = (gcnew System::Windows::Forms::TextBox());
			this->TabDisplay = (gcnew System::Windows::Forms::TabControl());
			this->UpcomingTab = (gcnew System::Windows::Forms::TabPage());
			this->UpcomingTextBox = (gcnew System::Windows::Forms::TextBox());
			this->TodayTab = (gcnew System::Windows::Forms::TabPage());
			this->TodayTextBox = (gcnew System::Windows::Forms::TextBox());
			this->MissedTab = (gcnew System::Windows::Forms::TabPage());
			this->MissedTextBox = (gcnew System::Windows::Forms::TextBox());
			this->FavouriteTab = (gcnew System::Windows::Forms::TabPage());
			this->FavouriteTextBox = (gcnew System::Windows::Forms::TextBox());
			this->FloatingTab = (gcnew System::Windows::Forms::TabPage());
			this->FloatTextBox = (gcnew System::Windows::Forms::TextBox());
			this->PastOperations = (gcnew System::Windows::Forms::TextBox());
			this->HelpPrompt = (gcnew System::Windows::Forms::Label());
			this->FloatingTasksLabel = (gcnew System::Windows::Forms::Label());
			this->PastActionLabel = (gcnew System::Windows::Forms::Label());
			this->tmrClock = (gcnew System::Windows::Forms::Timer(this->components));
			this->FunnyTxtBox = (gcnew System::Windows::Forms::TextBox());
			this->TabDisplay->SuspendLayout();
			this->UpcomingTab->SuspendLayout();
			this->TodayTab->SuspendLayout();
			this->MissedTab->SuspendLayout();
			this->FavouriteTab->SuspendLayout();
			this->FloatingTab->SuspendLayout();
			this->SuspendLayout();
			// 
			// InputTextBox
			// 
			this->InputTextBox->Anchor = System::Windows::Forms::AnchorStyles::None;
			this->InputTextBox->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 12, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point, 
				static_cast<System::Byte>(0)));
			this->InputTextBox->ForeColor = System::Drawing::SystemColors::WindowText;
			this->InputTextBox->Location = System::Drawing::Point(0, 610);
			this->InputTextBox->Name = L"InputTextBox";
			this->InputTextBox->Size = System::Drawing::Size(1124, 26);
			this->InputTextBox->TabIndex = 0;
			this->InputTextBox->TextChanged += gcnew System::EventHandler(this, &TaskExemplarGUI::InputTextBox_TextChanged);
			this->InputTextBox->KeyDown += gcnew System::Windows::Forms::KeyEventHandler(this, &TaskExemplarGUI::InputTextBox_KeyDown);
			// 
			// TabDisplay
			// 
			this->TabDisplay->Anchor = System::Windows::Forms::AnchorStyles::None;
			this->TabDisplay->Controls->Add(this->UpcomingTab);
			this->TabDisplay->Controls->Add(this->TodayTab);
			this->TabDisplay->Controls->Add(this->MissedTab);
			this->TabDisplay->Controls->Add(this->FavouriteTab);
			this->TabDisplay->Controls->Add(this->FloatingTab);
			this->TabDisplay->Font = (gcnew System::Drawing::Font(L"Comic Sans MS", 15.75F, System::Drawing::FontStyle::Bold, System::Drawing::GraphicsUnit::Point, 
				static_cast<System::Byte>(0)));
			this->TabDisplay->ItemSize = System::Drawing::Size(120, 30);
			this->TabDisplay->Location = System::Drawing::Point(0, 0);
			this->TabDisplay->Margin = System::Windows::Forms::Padding(0);
			this->TabDisplay->Name = L"TabDisplay";
			this->TabDisplay->RightToLeft = System::Windows::Forms::RightToLeft::No;
			this->TabDisplay->SelectedIndex = 0;
			this->TabDisplay->ShowToolTips = true;
			this->TabDisplay->Size = System::Drawing::Size(815, 620);
			this->TabDisplay->SizeMode = System::Windows::Forms::TabSizeMode::Fixed;
			this->TabDisplay->TabIndex = 2;
			this->TabDisplay->Selected += gcnew System::Windows::Forms::TabControlEventHandler(this, &TaskExemplarGUI::TabDisplay_Selected);
			// 
			// UpcomingTab
			// 
			this->UpcomingTab->BackColor = System::Drawing::Color::FromArgb(static_cast<System::Int32>(static_cast<System::Byte>(192)), static_cast<System::Int32>(static_cast<System::Byte>(255)), 
				static_cast<System::Int32>(static_cast<System::Byte>(192)));
			this->UpcomingTab->Controls->Add(this->UpcomingTextBox);
			this->UpcomingTab->ForeColor = System::Drawing::Color::Blue;
			this->UpcomingTab->Location = System::Drawing::Point(4, 34);
			this->UpcomingTab->Name = L"UpcomingTab";
			this->UpcomingTab->Padding = System::Windows::Forms::Padding(3);
			this->UpcomingTab->Size = System::Drawing::Size(807, 582);
			this->UpcomingTab->TabIndex = 0;
			this->UpcomingTab->Text = L"Console";
			// 
			// UpcomingTextBox
			// 
			this->UpcomingTextBox->Anchor = static_cast<System::Windows::Forms::AnchorStyles>((((System::Windows::Forms::AnchorStyles::Top | System::Windows::Forms::AnchorStyles::Bottom) 
				| System::Windows::Forms::AnchorStyles::Left) 
				| System::Windows::Forms::AnchorStyles::Right));
			this->UpcomingTextBox->BackColor = System::Drawing::Color::FromArgb(static_cast<System::Int32>(static_cast<System::Byte>(192)), static_cast<System::Int32>(static_cast<System::Byte>(255)), 
				static_cast<System::Int32>(static_cast<System::Byte>(192)));
			this->UpcomingTextBox->Font = (gcnew System::Drawing::Font(L"Lucida Console", 11.25F, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point, 
				static_cast<System::Byte>(0)));
			this->UpcomingTextBox->ForeColor = System::Drawing::SystemColors::WindowText;
			this->UpcomingTextBox->Location = System::Drawing::Point(0, 0);
			this->UpcomingTextBox->Margin = System::Windows::Forms::Padding(0);
			this->UpcomingTextBox->MaxLength = 64000;
			this->UpcomingTextBox->Multiline = true;
			this->UpcomingTextBox->Name = L"UpcomingTextBox";
			this->UpcomingTextBox->ReadOnly = true;
			this->UpcomingTextBox->ScrollBars = System::Windows::Forms::ScrollBars::Both;
			this->UpcomingTextBox->ShortcutsEnabled = false;
			this->UpcomingTextBox->Size = System::Drawing::Size(801, 576);
			this->UpcomingTextBox->TabIndex = 0;
			this->UpcomingTextBox->WordWrap = false;
			// 
			// TodayTab
			// 
			this->TodayTab->Controls->Add(this->TodayTextBox);
			this->TodayTab->Location = System::Drawing::Point(4, 34);
			this->TodayTab->Name = L"TodayTab";
			this->TodayTab->Padding = System::Windows::Forms::Padding(3);
			this->TodayTab->Size = System::Drawing::Size(807, 582);
			this->TodayTab->TabIndex = 2;
			this->TodayTab->Text = L"Today";
			this->TodayTab->UseVisualStyleBackColor = true;
			// 
			// TodayTextBox
			// 
			this->TodayTextBox->BackColor = System::Drawing::Color::FromArgb(static_cast<System::Int32>(static_cast<System::Byte>(192)), static_cast<System::Int32>(static_cast<System::Byte>(255)), 
				static_cast<System::Int32>(static_cast<System::Byte>(192)));
			this->TodayTextBox->Dock = System::Windows::Forms::DockStyle::Fill;
			this->TodayTextBox->Font = (gcnew System::Drawing::Font(L"Lucida Console", 11.25F, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point, 
				static_cast<System::Byte>(0)));
			this->TodayTextBox->Location = System::Drawing::Point(3, 3);
			this->TodayTextBox->Multiline = true;
			this->TodayTextBox->Name = L"TodayTextBox";
			this->TodayTextBox->ReadOnly = true;
			this->TodayTextBox->ScrollBars = System::Windows::Forms::ScrollBars::Both;
			this->TodayTextBox->Size = System::Drawing::Size(801, 576);
			this->TodayTextBox->TabIndex = 0;
			this->TodayTextBox->WordWrap = false;
			// 
			// MissedTab
			// 
			this->MissedTab->Controls->Add(this->MissedTextBox);
			this->MissedTab->Location = System::Drawing::Point(4, 34);
			this->MissedTab->Name = L"MissedTab";
			this->MissedTab->Padding = System::Windows::Forms::Padding(3);
			this->MissedTab->Size = System::Drawing::Size(807, 582);
			this->MissedTab->TabIndex = 3;
			this->MissedTab->Text = L"Missed";
			this->MissedTab->UseVisualStyleBackColor = true;
			// 
			// MissedTextBox
			// 
			this->MissedTextBox->BackColor = System::Drawing::Color::FromArgb(static_cast<System::Int32>(static_cast<System::Byte>(192)), static_cast<System::Int32>(static_cast<System::Byte>(255)), 
				static_cast<System::Int32>(static_cast<System::Byte>(192)));
			this->MissedTextBox->Dock = System::Windows::Forms::DockStyle::Fill;
			this->MissedTextBox->Font = (gcnew System::Drawing::Font(L"Lucida Console", 11.25F, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point, 
				static_cast<System::Byte>(0)));
			this->MissedTextBox->Location = System::Drawing::Point(3, 3);
			this->MissedTextBox->Multiline = true;
			this->MissedTextBox->Name = L"MissedTextBox";
			this->MissedTextBox->ReadOnly = true;
			this->MissedTextBox->ScrollBars = System::Windows::Forms::ScrollBars::Both;
			this->MissedTextBox->Size = System::Drawing::Size(801, 576);
			this->MissedTextBox->TabIndex = 0;
			// 
			// FavouriteTab
			// 
			this->FavouriteTab->Controls->Add(this->FavouriteTextBox);
			this->FavouriteTab->Location = System::Drawing::Point(4, 34);
			this->FavouriteTab->Name = L"FavouriteTab";
			this->FavouriteTab->Padding = System::Windows::Forms::Padding(3);
			this->FavouriteTab->Size = System::Drawing::Size(807, 582);
			this->FavouriteTab->TabIndex = 4;
			this->FavouriteTab->Text = L"Favourite";
			this->FavouriteTab->UseVisualStyleBackColor = true;
			// 
			// FavouriteTextBox
			// 
			this->FavouriteTextBox->BackColor = System::Drawing::Color::FromArgb(static_cast<System::Int32>(static_cast<System::Byte>(192)), 
				static_cast<System::Int32>(static_cast<System::Byte>(255)), static_cast<System::Int32>(static_cast<System::Byte>(192)));
			this->FavouriteTextBox->Dock = System::Windows::Forms::DockStyle::Fill;
			this->FavouriteTextBox->Font = (gcnew System::Drawing::Font(L"Lucida Console", 11.25F, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point, 
				static_cast<System::Byte>(0)));
			this->FavouriteTextBox->Location = System::Drawing::Point(3, 3);
			this->FavouriteTextBox->Multiline = true;
			this->FavouriteTextBox->Name = L"FavouriteTextBox";
			this->FavouriteTextBox->ScrollBars = System::Windows::Forms::ScrollBars::Both;
			this->FavouriteTextBox->Size = System::Drawing::Size(801, 576);
			this->FavouriteTextBox->TabIndex = 0;
			this->FavouriteTextBox->WordWrap = false;
			// 
			// FloatingTab
			// 
			this->FloatingTab->Controls->Add(this->FloatTextBox);
			this->FloatingTab->Location = System::Drawing::Point(4, 34);
			this->FloatingTab->Name = L"FloatingTab";
			this->FloatingTab->Size = System::Drawing::Size(807, 582);
			this->FloatingTab->TabIndex = 5;
			this->FloatingTab->Text = L"Floating";
			this->FloatingTab->UseVisualStyleBackColor = true;
			// 
			// FloatTextBox
			// 
			this->FloatTextBox->BackColor = System::Drawing::Color::FromArgb(static_cast<System::Int32>(static_cast<System::Byte>(192)), static_cast<System::Int32>(static_cast<System::Byte>(255)), 
				static_cast<System::Int32>(static_cast<System::Byte>(192)));
			this->FloatTextBox->Dock = System::Windows::Forms::DockStyle::Fill;
			this->FloatTextBox->Font = (gcnew System::Drawing::Font(L"Lucida Console", 11.25F, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point, 
				static_cast<System::Byte>(0)));
			this->FloatTextBox->Location = System::Drawing::Point(0, 0);
			this->FloatTextBox->Multiline = true;
			this->FloatTextBox->Name = L"FloatTextBox";
			this->FloatTextBox->ScrollBars = System::Windows::Forms::ScrollBars::Both;
			this->FloatTextBox->Size = System::Drawing::Size(807, 582);
			this->FloatTextBox->TabIndex = 0;
			this->FloatTextBox->WordWrap = false;
			// 
			// PastOperations
			// 
			this->PastOperations->Anchor = System::Windows::Forms::AnchorStyles::None;
			this->PastOperations->BackColor = System::Drawing::Color::FromArgb(static_cast<System::Int32>(static_cast<System::Byte>(255)), static_cast<System::Int32>(static_cast<System::Byte>(255)), 
				static_cast<System::Int32>(static_cast<System::Byte>(192)));
			this->PastOperations->Font = (gcnew System::Drawing::Font(L"Arial", 14.25F, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point, 
				static_cast<System::Byte>(0)));
			this->PastOperations->Location = System::Drawing::Point(821, 318);
			this->PastOperations->Multiline = true;
			this->PastOperations->Name = L"PastOperations";
			this->PastOperations->ReadOnly = true;
			this->PastOperations->ScrollBars = System::Windows::Forms::ScrollBars::Vertical;
			this->PastOperations->Size = System::Drawing::Size(303, 276);
			this->PastOperations->TabIndex = 3;
			this->PastOperations->Text = L" ";
			this->PastOperations->WordWrap = false;
			// 
			// HelpPrompt
			// 
			this->HelpPrompt->Anchor = System::Windows::Forms::AnchorStyles::None;
			this->HelpPrompt->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 12, System::Drawing::FontStyle::Italic, System::Drawing::GraphicsUnit::Point, 
				static_cast<System::Byte>(0)));
			this->HelpPrompt->ForeColor = System::Drawing::Color::Red;
			this->HelpPrompt->Location = System::Drawing::Point(0, 649);
			this->HelpPrompt->Name = L"HelpPrompt";
			this->HelpPrompt->Size = System::Drawing::Size(1114, 49);
			this->HelpPrompt->TabIndex = 5;
			this->HelpPrompt->Text = L"Add your task and press Enter\r\n";
			this->HelpPrompt->UseMnemonic = false;
			// 
			// FloatingTasksLabel
			// 
			this->FloatingTasksLabel->Anchor = System::Windows::Forms::AnchorStyles::None;
			this->FloatingTasksLabel->AutoSize = true;
			this->FloatingTasksLabel->Font = (gcnew System::Drawing::Font(L"Arial Black", 12, System::Drawing::FontStyle::Bold, System::Drawing::GraphicsUnit::Point, 
				static_cast<System::Byte>(0)));
			this->FloatingTasksLabel->ForeColor = System::Drawing::Color::Blue;
			this->FloatingTasksLabel->Location = System::Drawing::Point(821, -5);
			this->FloatingTasksLabel->Margin = System::Windows::Forms::Padding(0);
			this->FloatingTasksLabel->Name = L"FloatingTasksLabel";
			this->FloatingTasksLabel->Size = System::Drawing::Size(145, 23);
			this->FloatingTasksLabel->TabIndex = 6;
			this->FloatingTasksLabel->Text = L"Current Status:";
			// 
			// PastActionLabel
			// 
			this->PastActionLabel->Anchor = System::Windows::Forms::AnchorStyles::None;
			this->PastActionLabel->AutoSize = true;
			this->PastActionLabel->Font = (gcnew System::Drawing::Font(L"Arial Black", 12, System::Drawing::FontStyle::Bold, System::Drawing::GraphicsUnit::Point, 
				static_cast<System::Byte>(0)));
			this->PastActionLabel->ForeColor = System::Drawing::Color::Blue;
			this->PastActionLabel->Location = System::Drawing::Point(821, 292);
			this->PastActionLabel->Name = L"PastActionLabel";
			this->PastActionLabel->Size = System::Drawing::Size(127, 23);
			this->PastActionLabel->TabIndex = 7;
			this->PastActionLabel->Text = L"Past Actions:";
			// 
			// tmrClock
			// 
			this->tmrClock->Enabled = true;
			this->tmrClock->Interval = 200;
			this->tmrClock->Tick += gcnew System::EventHandler(this, &TaskExemplarGUI::tmrClock_Tick);
			// 
			// FunnyTxtBox
			// 
			this->FunnyTxtBox->Font = (gcnew System::Drawing::Font(L"Candara", 11.25F, System::Drawing::FontStyle::Bold, System::Drawing::GraphicsUnit::Point, 
				static_cast<System::Byte>(0)));
			this->FunnyTxtBox->Location = System::Drawing::Point(840, 36);
			this->FunnyTxtBox->Multiline = true;
			this->FunnyTxtBox->Name = L"FunnyTxtBox";
			this->FunnyTxtBox->ReadOnly = true;
			this->FunnyTxtBox->Size = System::Drawing::Size(125, 222);
			this->FunnyTxtBox->TabIndex = 8;
			this->FunnyTxtBox->TabStop = false;
			// 
			// TaskExemplarGUI
			// 
			this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);
			this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
			this->BackColor = System::Drawing::Color::FromArgb(static_cast<System::Int32>(static_cast<System::Byte>(192)), static_cast<System::Int32>(static_cast<System::Byte>(255)), 
				static_cast<System::Int32>(static_cast<System::Byte>(192)));
			this->ClientSize = System::Drawing::Size(1126, 681);
			this->Controls->Add(this->FunnyTxtBox);
			this->Controls->Add(this->PastActionLabel);
			this->Controls->Add(this->FloatingTasksLabel);
			this->Controls->Add(this->HelpPrompt);
			this->Controls->Add(this->PastOperations);
			this->Controls->Add(this->TabDisplay);
			this->Controls->Add(this->InputTextBox);
			this->Name = L"TaskExemplarGUI";
			this->StartPosition = System::Windows::Forms::FormStartPosition::CenterScreen;
			this->Text = L"TaskExemplar Version 0.0";
			this->Load += gcnew System::EventHandler(this, &TaskExemplarGUI::TaskExemplarGUI_Load);
			this->Resize += gcnew System::EventHandler(this, &TaskExemplarGUI::TaskExemplarGUI_Resize);
			this->TabDisplay->ResumeLayout(false);
			this->UpcomingTab->ResumeLayout(false);
			this->UpcomingTab->PerformLayout();
			this->TodayTab->ResumeLayout(false);
			this->TodayTab->PerformLayout();
			this->MissedTab->ResumeLayout(false);
			this->MissedTab->PerformLayout();
			this->FavouriteTab->ResumeLayout(false);
			this->FavouriteTab->PerformLayout();
			this->FloatingTab->ResumeLayout(false);
			this->FloatingTab->PerformLayout();
			this->ResumeLayout(false);
			this->PerformLayout();

		}
#pragma endregion

//@author A0087294R
	private: System::Void TaskExemplarGUI_Load(System::Object^  sender, System::EventArgs^  e) {
			/* Adds the event and the event handler for the method that will 
			 process the timer event to the timer. */
			//myTimer->Tick += gcnew EventHandler( TimerEventProcessor );

			//Sets the timer interval to 1 seconds.
			//myTimer->Interval = 1000;
			//myTimer->Start();
			TaskExemplarGUI_Resize(sender, e);
			UpcomingTextBox->AppendText (Stdtosys::getUpcomingText());
			InternalCommand newInternal;
			newInternal.trigger_startUp();
			PastOperations->Clear();
			PastOperations->AppendText(Stdtosys::getPassedActionString());
			TodayTextBox->Clear();
			TodayTextBox->AppendText (Stdtosys::getTodayText());
			MissedTextBox->Clear();
			MissedTextBox->AppendText (Stdtosys::getMissedText());
			FavouriteTextBox->Clear();
			FavouriteTextBox->AppendText (Stdtosys::getFavouriteText());
			FloatTextBox->Clear();
			FloatTextBox->AppendText (Stdtosys::getFloatingText());
	}
	
	// This is the method to run when the timer is raised. 
    static void TimerEventProcessor( Object^ /*myObject*/, EventArgs^ /*myEventArgs*/ )
    {
			myTimer->Stop();

			// Displays a message box asking whether to continue running the timer. 
			if ( alarmCounter < 3 ){
				// Restarts the timer and increments the counter.
				alarmCounter += 1;
				MessageBox::Show("hello");
				myTimer->Enabled = true;
			} else if (alarmCounter == 3){
				// Stops the timer.
			}
    }

	//@author A0083782W
	private: System::Void InputTextBox_KeyDown(System::Object^  sender, System::Windows::Forms::KeyEventArgs^  e) {
			InternalCommand newInternal;
			if ( e->KeyCode == Keys::Enter ){
				ReadSettingPtr ptr = &Settings::get();
				string convertedToString = Stdtosys::convertToStdString(InputTextBox->Text);
				userCommand->analyse(convertedToString);
				newInternal.trigger_pushBack (convertedToString);
				newInternal.trigger_moveToTail();
				InputTextBox->Clear();
				//HelpPrompt->Text = outputDisplay->getLabelText();
				if (Stdtosys::getClearUpcoming()) {
					UpcomingTextBox->Clear();
				}
				UpcomingTextBox->AppendText (Stdtosys::getUpcomingText());
				PastOperations->Clear();
				PastOperations->AppendText(Stdtosys::getPassedActionString());
				TodayTextBox->Clear();
				TodayTextBox->AppendText (Stdtosys::getTodayText());
				MissedTextBox->Clear();
				MissedTextBox->AppendText (Stdtosys::getMissedText());
				FavouriteTextBox->Clear();
				FavouriteTextBox->AppendText (Stdtosys::getFavouriteText());
				FloatTextBox->Clear();
				FloatTextBox->AppendText (Stdtosys::getFloatingText());
				if (Stdtosys::getShutdown()) {
					Application::Exit();
				}
			}
			else if (e->KeyCode == Keys::Up) {
				newInternal.trigger_moveUp();
				newInternal.trigger_generateHistory();
				InputTextBox->Clear();
				InputTextBox->AppendText (Stdtosys::getInputText());
			}
			else if (e->KeyCode == Keys::Down) {
				newInternal.trigger_moveDown();
				newInternal.trigger_generateHistory();
				InputTextBox->Clear();
				InputTextBox->AppendText (Stdtosys::getInputText());
			}
		}
	
	private: System::Void TaskExemplarGUI_Resize(System::Object^  sender, System::EventArgs^  e) {
			//UpcomingTextBox->Text = "wahahahah";
			Control^ control = dynamic_cast<Control^>(sender);
			if (control->Size.Height < MINIMUM_HEIGHT && control->Size.Width < MINIMUM_WIDTH) {
				control->Size = Drawing::Size(MINIMUM_WIDTH, MINIMUM_HEIGHT);	
			}
			else if (control->Size.Height < MINIMUM_HEIGHT) {
				control->Size = Drawing::Size(control->Size.Width, MINIMUM_HEIGHT);
			}
			else if (control->Size.Width < MINIMUM_WIDTH) {
				control->Size = Drawing::Size(MINIMUM_WIDTH, control->Size.Height);
			}
			int TotalHeight = control->Size.Height;
			int TotalWidth = control->Size.Width - MARGIN;
			TabDisplay->Location = Point (0,0);
			int leftWidth = (int)(LEFT_PORTION * TotalWidth);
			int rightWidth = (int) ((1.0-LEFT_PORTION) * TotalWidth);
			int upperHeight= TotalHeight - (120);
			TabDisplay->Size = Drawing::Size (leftWidth,upperHeight);
			FloatingTasksLabel->Location = Point (leftWidth + MARGIN, MARGIN);
			FunnyTxtBox->Location = Point (leftWidth + MARGIN, FloatingTasksLabel->Size.Height + 2 * MARGIN);
			FunnyTxtBox->Size = Drawing::Size (rightWidth - 20, upperHeight/3 - FloatingTasksLabel->Size.Height - 2*MARGIN);
			PastActionLabel->Location = Point (leftWidth + MARGIN, upperHeight/3 + MARGIN);
			PastOperations->Location = Point(leftWidth + MARGIN, upperHeight/3 + 2*MARGIN + PastActionLabel->Size.Height);
			PastOperations->Size = Drawing::Size (rightWidth - 20, upperHeight/3*2 - PastActionLabel->Size.Height - 2*MARGIN);
			InputTextBox->Location = Point (MARGIN, upperHeight + MARGIN);
			InputTextBox->Width = TotalWidth - MARGIN*4;
			HelpPrompt->Location = Point (MARGIN, upperHeight + MARGIN*2 + InputTextBox->Size.Height);
			HelpPrompt->Width = TotalWidth - MARGIN *2;
		}

	private: System::Void InputTextBox_TextChanged(System::Object^  sender, System::EventArgs^  e) {
			InternalCommand newInternal;
			newInternal.trigger_hinter (Stdtosys::convertToStdString((InputTextBox->Text)));
			HelpPrompt->Text = Stdtosys::getPromptText();
		}

	private: System::Void TabDisplay_Selected(System::Object^  sender, System::Windows::Forms::TabControlEventArgs^  e) {
			ByteInt currentTab = 0;
			if (TabDisplay->SelectedTab->Text == "Console") {
				currentTab = 0;
			}
			else if (TabDisplay->SelectedTab->Text == "Today") {
				currentTab = 1;
			}
			else if (TabDisplay->SelectedTab->Text == "Missed") {
				currentTab = 2;
			}
			else if (TabDisplay->SelectedTab->Text == "Favourite") {
				currentTab = 3;
			}
			else if (TabDisplay->SelectedTab->Text ==  "Floating") {
				currentTab = 4;
			}
			else {
				currentTab = 5;
			}
			Stdtosys::sendTabsID (currentTab);
		}

	private: System::Void tmrClock_Tick(System::Object^  sender, System::EventArgs^  e) {
			tmrClock->Enabled = false;
			InternalCommand newInternal;
			newInternal.trigger_callEvents();
			while (Stdtosys::getNotEmptyQueue()) {
				newInternal.trigger_dequeueDueEvents();
				Windows::Forms::DialogResult result;
				String^ msg = Stdtosys::getMsgText ();
				PlaySound(TEXT("D:\\haha.wav"), NULL, SND_FILENAME|SND_ASYNC|SND_LOOP);
				result = MessageBox::Show (this, msg, "Event Due, please choose an action:" ,
					MessageBoxButtons::YesNo, MessageBoxIcon::Information,MessageBoxDefaultButton::Button1);

				if (result == Windows::Forms::DialogResult::Yes) {
					newInternal.trigger_markDone();
				}
				else {
					newInternal.trigger_markMissed();
				}
				newInternal.trigger_markRemind();
				PlaySound (NULL,0,0);
			}
			
			FunnyTxtBox->Text = Stdtosys::getStatusText();

			static ByteInt counter = 0;
			counter ++;
			if (counter >= 100) {
				int R_ = getRandomNumber (0, 255);
				int B_ = getRandomNumber (0, 255);
				int G_ = getRandomNumber (0, 255);
				FunnyTxtBox->BackColor = Drawing::Color::FromArgb(
					static_cast<System::Int32> (static_cast<System::Byte>(R_)), 
					static_cast<System::Int32>(static_cast<System::Byte>(B_)), 
					static_cast<System::Int32>(static_cast<System::Byte>(G_)));
				FunnyTxtBox->ForeColor = Drawing::Color::FromArgb (
					static_cast<System::Int32> (static_cast<System::Byte>(255-R_)), 
					static_cast<System::Int32>(static_cast<System::Byte>(255-B_)), 
					static_cast<System::Int32>(static_cast<System::Byte>(255-G_)));
				counter = 0;
			}
			tmrClock->Enabled = true;
		}
};
}